/**
 * Copyright 2012 Fonfon.Fenceer
 * All rights reserved.
 * 
 * @project 
 * @author Fonfon.Fenceer
 * @version 1.0
 * @data 2012-3-25
 */
package com.guidecaptain.java.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.SelectKey;

import com.guidecaptain.java.model.pojo.Uploadify;

/**
 * 
 * @author fenceer
 */
public interface UploadifyMapper {

	@Insert("insert into uploadify (user_id,file_name,file_size,file_type,file_path,gmt_create) "
			+ "values (#{userId},#{fileName},#{fileSize},#{fileType},#{filePath},now())")
	@SelectKey(statement = "SELECT LAST_INSERT_ID() AS ID ", keyProperty = "fileId", resultType = int.class, before = true)
	int insertUploadify(Uploadify uploadify);

	@Delete("delete from uploadify where file_id = #{fileId}")
	int deleteUploadify(int fileId);

}
